﻿Module mdlConexion
    Public blnOnDB As Boolean
    'Configuración conexión a base de datos Postgres
    Public idcon As New Odbc.OdbcConnection '("Driver={PostgreSQL ANSI};Server=127.0.0.1;Port=5432;Database=dbwsin;Uid=postgres;Pwd=complex")

    Public Sub conexion()
        Dim strStringconn As String = "Driver=" & mdlHerramientas.strDriver & ";Server=" & mdlHerramientas.strServer & ";Port=" & mdlHerramientas.strPort & ";Database=" & mdlHerramientas.strDatabase & ";Uid=" & mdlHerramientas.strUid & ";Pwd=" & mdlHerramientas.strPwd
        Dim strStringconnws As String = "Driver=" & mdlHerramientas.strDriver & ";Server=" & mdlHerramientas.strServer & ";Port=" & mdlHerramientas.strPort & ";Database=" & mdlHerramientas.strDatabasews & ";Uid=" & mdlHerramientas.strUid & ";Pwd=" & mdlHerramientas.strPwd

        If blnOnDB = True Then
            idcon.ConnectionString = strStringconnws
        Else
            idcon.ConnectionString = strStringconn
        End If
    End Sub
End Module
